sub main()
with metascript
      set rs = .sumrs("Select Code, Name, DoorNo, Street, gstin, idarea, areaname, cell, phone, PIN, customerkey from customer where customerkey  in (select customerid from salehead ) " & _
         " and len(GSTIN)=15 and (len(pin)<>6  or len(IDArea)<3 or isnull(doorno,'')='' or isnull(street,'')='') ", .getdatafile)
      filename = local.getfilename("Enter filename to save customer list", "xls")
      local.dumprstoexcel rs, filename
      msgbox "Saved successfully at "  & filename
end with
end sub

